﻿using OMG.Fill.Mulberry.Model.Ent;
using OMG.Fill.Mulberry.Service;
using ProjectShare;
using System.Collections.Generic;
using System.Web.Http;
namespace OMG.Fill.Mulberry.Model.UI.Controllers
{
    public class MenuActionController : ApiController
    {
        MenuActionServices menuActionServices = new MenuActionServices();
        
        //[ApiActionAuthorize("获取菜单操作权限表T_Menu_Action分页列表对象操作")]
        //[ApiActionException]
        public Pager<List<MenuActionEntity>> PostPageList(MenuActionQuery query)
        {
            return menuActionServices.GetPageList(query);
        }
        //[ApiActionAuthorize("新增菜单操作权限表T_Menu_Action指定对象操作")]
        //[ApiActionException]
        public ResResult<int> Post(MenuActionModel model) {
            return menuActionServices.AddInfo(model);
        }
        //[ApiActionAuthorize("修改菜单操作权限表T_Menu_Action指定对象操作")]
        //[ApiActionException]
        public ResResult<int> Put(MenuActionEntity model)
        {
            return menuActionServices.UpdateInfo(model);
        }
        //[ApiActionAuthorize("删除菜单操作权限表T_Menu_Action指定对象操作")]
        //[ApiActionException]
        public ResResult<int> Delete(string id)
        {
            return menuActionServices.DeleteInfo(id);
        }
        /// <summary>
        /// 获取编辑的菜单操作列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        //[ApiActionAuthorize("获取菜单操作权限表T_Menu_Action指定对象操作")]
        //[ApiActionException]
        public ResResult<List<MenuActionEntity>> Get(string id)
        {
            return menuActionServices.GetEditList(id);
        }
        /// <summary>
        /// 获取启用的菜单操作列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ResResult<List<MenuActionEntity>> GetList(string id)
        {
            return menuActionServices.GetList(id);
        }
    }
}